@layout("/common/_curd/_container.html"){

	<form data-url="${basePath}/${code}/save" method="post" class="form-horizontal" role="form">
		<!-- 表单 -->
		@ var _table="tb_template";
		@ var _col=[
		@			  {name:"模板名称", index:"name", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"模板签名", index:"templateSign", type:"text",newline:true,length:8},	
		@			  {name:"模板状态", index:"status", type:"select_908",newline:true,length:8,required:"required"},
		@			  {name:"发布时间", index:"pubTime",type:"laydate",value:func.getTime(),newline:true,length:8,required:"required"},
		@			  {name:"修改时间", index:"modifyTime",type:"laydate",value:func.getTime(),newline:true,length:8,required:"required"},		
		@			  {name:"模板概述", index:"mark", type:"text",newline:true,length:8},	
		@			  {name:"所属银行", index:"bank_id", type:"select_910",newline:true,length:8,required:"required"},		
		@			  {name:"银行业务", index:"bussiness_id", type:"hidden",newline:true,length:8,required:"required"},
		@			  {name:"所属模板类型", index:"category_id", type:"select_920",newline:true,length:8,required:"required"}				
		@		   ];
		@ include("/common/_curd/_add.html", {"col":_col, "table":_table}){}
		
	
			<div class="form-group form-bussiness" style="display: block">
			<label class="col-sm-2 control-label no-padding-right">银行业务 </label>
			<div class="col-sm-8">
				<select onchange="_bussiness_id_selectChanged('bussiness_id')" 
					class="form-control" id="bussiness_id">
					<option value=""></option>
				</select>
				<script type="text/javascript">
					function _bussiness_id_selectChanged(sid) {
						//$('#' + sid).attr('name', 'tb_pt_parking_info.area_id');
						$("#_bussiness_id").val($('#' + sid).val());
					};
				</script>
			</div>
		</div>
			<!-- 按钮 -->
		@ include("/common/_curd/_btn.html", {btn_save:"新增", btn_close:"关闭"}) {}
		
	</form>
<script type="text/javascript">
$(function() {

	//任务下拉框联动  
	$(".form-area").insertAfter($("#_bank_id").parent().parent());
	function changeBank(){
		var selectReq = $("#_bank_id").val();
		if(selectReq == "") return;
		$.ajax({
			url: "/template/getBussinessList/" + selectReq,
			type: "post",
			dataType: "json", // 接受数据格式   
			error: function() {
				alert("请求失败!");
			},
			success: function(data) {
				var str = "";
				if(data != null && data != "") {
					str += "<option value=''>请选择</option>";
					for(var i = 0; i < data.length; i++) {
						str += "<option value='" + data[i].id + "'>" + data[i].name + "</option>";
					}
					
				}
				$("#bussiness_id").html(str);
			}
		});
	}
	$("#_bank_id").bind("change", function() {
		changeBank();
	});
	})
	</script>
@}
